{% load i18n %}

<div class="actions flex flex-col gap-3 order-last lg:order-none lg:flex-row lg:items-center">
    {% block actions %}
        <div class="flex flex-col gap-2 lg:flex-row" x-data="{action: ''}">
            {% block actions-form %}
                {% for field in action_form %}
                    {% if field.label %}
                        <label>
                            {{ field.label }}
                    {% endif %}

                    {{ field }}

                    {% if field.label %}
                        </label>
                    {% endif %}
                {% endfor %}
            {% endblock %}

            {% block actions-submit %}
                <button type="submit" x-show="action" class="bg-primary-600 cursor-pointer flex font-medium items-center justify-center px-3 py-2 rounded-md text-sm text-white whitespace-nowrap" title="{% translate "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">
                    {% trans "Run" %}
                </button>
            {% endblock %}
        </div>

        {% block actions-counter %}
            {% if actions_selection_counter %}
                <div class="bg-gray-100 flex flex-row gap-2 h-9.5 items-center px-3 rounded-md shadow-sm truncate dark:bg-white/[.04] lg:bg-transparent dark:lg:!bg-transparent lg:px-0 lg:shadow-none">
                    <span class="action-counter text-sm" data-actions-icnt="{{ cl.result_list|length }}">
                        {{ selection_note }}
                    </span>

                    {% if cl.result_count != cl.result_list|length %}
                        <span class="all hidden text-gray-500 text-sm">
                            {{ selection_note_all }}
                        </span>

                        {% if not cl.model_admin.list_disable_select_all %}
                            <span class="question hidden text-primary-600 text-sm dark:text-primary-500">
                                <a href="#" title="{% translate "Click here to select the objects across all pages" %}">
                                    {% blocktranslate with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktranslate %}
                                </a>
                            </span>

                            <span class="clear hidden text-sm text-red-600">
                                <a href="#">
                                    {% translate "Clear selection" %}
                                </a>
                            </span>
                        {% endif %}
                    {% endif %}
                </div>
            {% endif %}
        {% endblock %}
    {% endblock %}
</div>
